package edu.wtbu.cs.androiddemo.activity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import edu.wtbu.cs.androiddemo.R;
import edu.wtbu.cs.androiddemo.activity.list.GoodsListActivity;
import edu.wtbu.cs.androiddemo.activity.list.GridViewSampleActivity;
import edu.wtbu.cs.androiddemo.activity.list.ListViewSampleActivity;
import edu.wtbu.cs.androiddemo.activity.list.RecyclerViewSampleActivity;
import edu.wtbu.cs.androiddemo.activity.list.SpinnerSampleActivity;

public class ListComponentSampleActivity extends AppCompatActivity {

    String logTag = ListComponentSampleActivity.class.getName();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_list_component_sample);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });
    }

    public void onClickGoodsListButton(View view){
        Log.i(logTag,"onClickGoodsListButton");
        Intent intent = new Intent(ListComponentSampleActivity.this, GoodsListActivity.class);
        startActivity(intent);
    }


    public void onClickSpinnerButton(View view){
        Log.i(logTag,"onClickSpinnerButton");
        Intent intent = new Intent(ListComponentSampleActivity.this, SpinnerSampleActivity.class);
        startActivity(intent);
    }

    public void onClickListViewButton(View view){
        Log.i(logTag,"onClickListViewButton");
        Intent intent = new Intent(ListComponentSampleActivity.this, ListViewSampleActivity.class);
        startActivity(intent);
    }

    public void  onClickGridViewButton(View view){
        Log.i(logTag,"onClickGridViewButton");
        Intent intent = new Intent(ListComponentSampleActivity.this, GridViewSampleActivity.class);
        startActivity(intent);
    }

    public void onClickRecyclerViewButton(View view){
        Log.i(logTag,"onClickRecyclerViewButton");
        Intent intent = new Intent(ListComponentSampleActivity.this, RecyclerViewSampleActivity.class);
        startActivity(intent);
    }
}